<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="名榜" http-equiv="keywords">
<meta name="description" content="名榜,wangid">
<meta name="viewport" content="width=device-width,user-scalable=no, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<title>修改个人资料</title>
<!-- css -->
<link rel="stylesheet" type="text/css" href="css/index.css">
<link href="css/skitter.style.css" type="text/css"rel="stylesheet" />
<!-- js -->

<!-- Init Skitter -->

</head>

<body>
	<div id="app">

		<div class="content">
			<div class="wid_con loginbox">
				<div class="register_txt">
					<div class="table-conte">
						<img src="images/tuding.png"/>
						<h1>填报说明 <a href="" class="fr">政策落实填报通知</a></h1>
						<p>1、调查表适用于郑洛新国家自主创新示范区内统计本地区落实国家推广的股权和分红激励改革、科技成果处置权和收益权改革、支持创新创业的税收政策等情况。请各主体单位选择合适的调查表进行填报。</p>
						<p>2、数据调查范围按照各示范区实际管理面积计算，时间范围自2016年1月1日至2018年6月30日（具体时间以表格为准）。</p>
						<p>3、如有问题请联系河南省科学技术信息研究院科技发展研究中心。联系电话：0371-65954220  65967098。</p>
					</div>
				</div>
				<div class="register_con password_con">
					<div class="text_box">
						<div>
							<div>
								<i><img src="images/icon01.png"></i>
								<input type="text" v-model="UserInfo.UserName" readonly="readonly" placeholder="单位全称">
							</div>
							<div><i><img src="images/icon02.png"></i><input type="password" v-model="UserInfo.Password" placeholder="请输入您的新密码">
								<span>*</span>
							</div>
							<div><i><img src="images/icon02.png"></i><input type="password" v-model="UserInfo.Password" placeholder="请再次输入您的新密码">
								<span>*</span>
								<p v-if="Isvisible" class="rule">两次密码输入不同</p>
							</div>							
							<!--<div>
								<i><img src="images/icon05.png"></i>
								<select class="form-control" v-model="UserInfo.City"  >
					        		<option value="0">请选择地区</option>
					                <option value="郑州">郑州</option>
					                <option value="洛阳">洛阳</option>
					                <option value="新乡">新乡</option>
								</select>    							
								<span>*</span>
							</div>							-->
							<div><i><img src="images/icon04.png"></i><input type="email"  v-model="UserInfo.Email" placeholder="请输入您的信箱">
								<span>*</span>
							</div>
							<div><i><img src="images/icon06.png"></i><input type="text"  v-model="UserInfo.Telephone" placeholder="请输入电话">
								<span>*</span>
							</div>						
							<!--<div class="yzm">
								<i><img src="images/icon03.png"></i><input type="text" placeholder="请输入验证码">
								<label><img src="images/yzm.png"></label><span>*</span>
							</div>
							<h4><a href="#">《网站服务协议》</a></h4>-->
							<button v-on:click="editUnifopost">确认修改</button>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- footer -->
		<div class="footer">
			<p>版权所有&nbsp;&nbsp;&nbsp;Copyright © WangID驰通网络&nbsp;&nbsp;&nbsp;&nbsp;电话：400-6677-937</p>
			<p><a>京ICP备：14012449号</a>黔ICP证：黔B2-20140009号<span>京公网安备：11010602030054号</span></p>
		</div>
	</div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="js/public.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
<script type="text/javascript" src="js/ComFunJS.js" ></script>
<script type="text/javascript">
	var model= new Vue({
		el:'#app',
		data:{
			UserInfo:{
			},
			Isvisible:false,
		},
		methods:{
			getUserInfo:function(){						
				$.getJSON('/api/user/userinfo',{
				},function(r){
					if(r.error==""){
						r.result.Password="";
						r.result.aginPassword=""
						model.UserInfo=r.result
					}
				})
			},
			editUnifopost:function(){				
				if(model.UserInfo.aginPassword!=model.UserInfo.Password){
					model.Isvisible=true;
					return;
				}else{
					model.Isvisible=false;
				}					
				$.post('/api/user/updateuserinfo',{
					Telephone:model.UserInfo.Telephone,
					Password:model.UserInfo.Password,
					Email:model.UserInfo.Email,
				},function(r){
					if(r.error==''){
						alert('修改成功')
						window.location.href='person.html'
					}else{
						alert(r.error)
					}
				})
			}			
		},
		mounted:function(){
			this.$nextTick(function(){
				if(ComFunJS.isLogin()){
					model.getUserInfo()
				}else{
					window.location.href='login.html'
				}				
			})
		}		
	})
	
</script>
</html>